import request from '@/utils/request'

// 登录
export function userLogin(data: any) {
  return request({
    url: '/v1/admin/login',
    method: 'post',
    data: data
  })
}

// 修改密码
export function putchangePassword(data: any) {
  return request({
    url: '/v1/admin/system/changePassword',
    method: 'put',
    data: data
  })
}

// 后台账号列表
export function systemManagerList(params: any) {
  return request({
    url: '/v1/admin/system/managerList',
    method: 'get',
    params: params
  })
}

// 后台账号添加
export function systemAddManager(data: any) {
  return request({
    url: '/v1/admin/system/addManager',
    method: 'post',
    data: data
  })
}

// 后台账号更新
export function systemChangeManager(data: any) {
  return request({
    url: '/v1/admin/system/changeManager',
    method: 'put',
    data: data
  })
}

// 后台账号删除
export function systemDestroyManager(data: any) {
  return request({
    url: '/v1/admin/system/destroyManager',
    method: 'delete',
    data: data
  })
}

// 账号权限列表
export function systemRoleList(params: any) {
  return request({
    url: '/v1/admin/system/roleList',
    method: 'get',
    params: params
  })
}

// 账号权限添加
export function systemAddRole(data: any) {
  return request({
    url: '/v1/admin/system/addRole',
    method: 'post',
    data: data
  })
}
// 账号权限更新
export function systemChangeRole(data: any) {
  return request({
    url: '/v1/admin/system/changeRole',
    method: 'put',
    data: data
  })
}
// 账号权限删除
export function systemDestroyRole(data: any) {
  return request({
    url: '/v1/admin/system/destroyRole',
    method: 'delete',
    data: data
  })
}
// 获取所有得权限
export function permissionGetTree(params: any) {
  return request({
    url: '/v1/admin/permission/getTree',
    method: 'get',
    params: params
  })
}
// 登录日志列表
export function systemLoginLogList(params: any) {
  return request({
    url: '/v1/admin/system/loginLogList',
    method: 'get',
    params: params
  })
}
// 行为日志列表
export function systemActionLogList(params: any) {
  return request({
    url: '/v1/admin/system/actionLogList',
    method: 'get',
    params: params
  })
}
// 总代-中控模拟登录
export function simulatedOperatorLogin(data: any) {
  return request({
    url: '/v1/admin/simulatedOperatorLogin',
    method: 'post',
    data: data
  })
}
// 商户的中控模拟登录
export function simulatedAgentLogin(data: any) {
  return request({
    url: '/v1/merchant/simulatedLogin',
    method: 'post',
    data: data
  })
}

// 获取服务器时间
export function getTime(params: any) {
  return request({
    url: '/v1/admin/getTime',
    method: 'get',
    params: params
  })
}
